home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
WWPaketkarteNN+Z.outrexx
< prev
next >
Wrap
Text File
|
1998-10-29
|
6KB
|
213 lines
/*
** Druck-, Vorschau, Sichern der Nachnahme Paketkarte + Zahlschein zur Rechnung mit Hilfe von Wordworth
** $VER: WWPaketkarteNN+Z.outrexx V1.02 (30.10.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
WWVorlage = "WWDokumente/PaketkarteNN+Z.ww";
WWDokument = "t:PaketkarteNN+Z.ww";
WWPort = "WORDWORTH."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (WWPort || i)) THEN
DO;
Gefunden = 1;
WWPort = WWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "WordWorth ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original WW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
WWVorlage = MTR_RESULT || WWVorlage;
ADDRESS COMMAND "copy" WWVorlage WWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
/* Neues Dokument öffnen */
ADDRESS VALUE WWPort;
NEW;
WWPort = RESULT;
ADDRESS VALUE ARexxPort;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE WWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE WWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ADDRESS VALUE ARexxPort;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" WWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Rechnung = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || MTR_RESULT), PREFS.NUMBER_DIGITS );
ELSE
ZW_Rechnung = MTR_RESULT;
NAME_OF_SALUTATION OB.INVOICEE.CUSTOMER.ADDRESS.SALUTATION;
ZW_Anrede = MTR_RESULT;
/* Betrag korrekt formatieren, Währungssymbol separieren */
i = OB.CURRENCY_USED;
FORMAT_MONEY2 OB.TOTAL_ADD_M_ALL_CH.i;
j = index( MTR_RESULT, PREFS.CURRENCYSYMBOL );
l1 = j - 1;
l2 = LENGTH( MTR_RESULT ) - l1 - LENGTH( PREFS.CURRENCYSYMBOL );
IF i < 2 THEN
FORMAT_MONEY1 OB.TOTAL_ADD_M_ALL_CH.i;
ZW_Betrag = LEFT(MTR_RESULT, l1) || RIGHT(MTR_RESULT, l2);
ZW_WSymbol = SUBSTR(MTR_RESULT, j, (LENGTH( MTR_RESULT ) - l1 - l2) );
/* Betrag korrekt formatieren (Zahlschein)*/
FORMAT_MONEY2 OB.TOTAL_M_ALL_CH.i;
j = index( MTR_RESULT, PREFS.CURRENCYSYMBOL );
l1 = j - 1;
l2 = LENGTH( MTR_RESULT ) - l1 - LENGTH( PREFS.CURRENCYSYMBOL );
IF i < 2 THEN
FORMAT_MONEY1 OB.TOTAL_M_ALL_CH.i;
ZW_BetragZS = LEFT(MTR_RESULT, l1) || RIGHT(MTR_RESULT, l2);
IF PREFS.CLIENT_CODE = 1 THEN
ZW_Kunde = OB.INVOICEE.CUSTOMER.CLIENT_CODE;
ELSE IF PREFS.NUMBER_DIGITS > 0 THEN
ZW_Kunde = RIGHT( (Copies("0",PREFS.NUMBER_DIGITS) || OB.INVOICEE_NUMBER), PREFS.NUMBER_DIGITS );
ELSE
ZW_Kunde = OB.INVOICEE_NUMBER;
ADDRESS VALUE WWPort;
OPEN FILENAME WWDokument FORCE;
POSITION SOF;
IF OB.OFFICE.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = OB.OFFICE.ADDRESS.COMPANY1;
ELSE
ZW_Adresse = OB.OFFICE.ADDRESS.PRENAME OB.OFFICE.ADDRESS.SURNAME;
FINDCHANGE FIND "<SENDER.SUR_PRENAME>" CHANGE ZW_Adresse;
FINDCHANGE FIND "<SENDER.SUR_PRENAME>" CHANGE ZW_Adresse;
POSITION SOF;
FINDCHANGE FIND "<SENDER.STREET>" CHANGE OB.OFFICE.ADDRESS.STREET;
POSITION SOF;
FINDCHANGE FIND "<SENDER.ZIP>" CHANGE OB.OFFICE.ADDRESS.ZIP;
POSITION SOF;
FINDCHANGE FIND "<SENDER.CITY>" CHANGE OB.OFFICE.ADDRESS.CITY;
POSITION SOF;
FINDCHANGE FIND "<OB.TOTAL>" CHANGE ZW_Betrag;
POSITION SOF;
FINDCHANGE FIND "<SENDER.ACCOUNT>" CHANGE OB.OFFICE.ADDRESS.ACCOUNT;
FINDCHANGE FIND "<SENDER.ACCOUNT>" CHANGE OB.OFFICE.ADDRESS.ACCOUNT;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.SALUTATION>" CHANGE ZW_Anrede;
POSITION SOF;
FINDCHANGE FIND "<SENDER.BANK_SHORT>" CHANGE OB.OFFICE.ADDRESS.BANK_SHORT;
POSITION SOF;
IF OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1;
ELSE
ZW_Adresse = OB.INVOICEE.CUSTOMER.ADDRESS.PRENAME OB.INVOICEE.CUSTOMER.ADDRESS.SURNAME;
FINDCHANGE FIND "<RECEIVER.SUR_PRENAME>" CHANGE ZW_Adresse;
FINDCHANGE FIND "<RECEIVER.SUR_PRENAME>" CHANGE LEFT((ZW_Adresse || ", " || OB.INVOICEE.CUSTOMER.ADDRESS.CITY), 27);;
POSITION SOF;
FINDCHANGE FIND "<S.BANK_C_NR>" CHANGE OB.OFFICE.ADDRESS.BANK_CODE_NUMBER;
FINDCHANGE FIND "<S.BCM>" CHANGE OB.OFFICE.ADDRESS.BANK_CODE_NUMBER;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.STREET>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.STREET;
POSITION SOF;
FINDCHANGE FIND "<R.ZIP>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.ZIP;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.CITY>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.CITY;
POSITION SOF;
FINDCHANGE FIND "<SENDER.BANK_NAME>" CHANGE LEFT(OB.OFFICE.ADDRESS.BANK_NAME,27);
POSITION SOF;
FINDCHANGE FIND "<B.TOTAL>" CHANGE ZW_BetragZS;
FINDCHANGE FIND "<B.TOTAL>" CHANGE ZW_BetragZS;
POSITION SOF;
FINDCHANGE FIND "<W>" CHANGE ZW_WSymbol;
POSITION SOF;
FINDCHANGE FIND "<B.BILL_NUMBER>" CHANGE ZW_Rechnung;
POSITION SOF;
FINDCHANGE FIND "<SEND.NUMBER>" CHANGE ZW_Kunde;
RETURN;